package cn.xluobo.business.wechat.miniapp.student.controller;

import cn.xluobo.business.sc.student.domain.req.ReqSearchStudentCourse;
import cn.xluobo.business.sc.student.domain.resp.RespStudentCourse;
import cn.xluobo.business.wechat.miniapp.student.service.WechatMiniStudentCourseService;
import cn.xluobo.core.api.APIResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：KingLong
 * @date ：Created in 2020/11/11 20:20
 */
@RestController
@RequestMapping("/api/wechat/miniapp/{appId}/student/course")
public class WechatMiniStudentCourseController {

    @Autowired
    private WechatMiniStudentCourseService miniStudentCourseService;

    /**
     * 学生报读课程列表
     * @param reqSearchStudentCourse
     * @return
     */
    @GetMapping("/searchStudentCourse")
    public APIResponse searchStudentCourse(ReqSearchStudentCourse reqSearchStudentCourse){
        List<RespStudentCourse> respStudentCourses = miniStudentCourseService.searchStudentCourse(reqSearchStudentCourse);
        return APIResponse.toAPIResponse(respStudentCourses);
    }
}
